/**
 * 整体项目设置相关的 store
 */

// import Cookies from 'js-cookie'
// import { setTheme } from '@/utils'

const app = {
  namespaced: true,
  state: {
    collapsed: false,
    menuTheme: 'light'
  },
  mutations: {
    TOGGLE_COLLAPSED: (state) => {
      state.collapsed = !state.collapsed
    },
    TOGGLE_THEME: (state, val) => {
      state.menuTheme = val
    }
  },
  actions: {
    toggleCollapsed({ commit }) {
      commit('TOGGLE_COLLAPSED')
    },
    toggleMenuTheme({ commit }, val) {
      commit('TOGGLE_THEME', val)
    }
  }
}

export default app